<?php
include '../../auth/ceklogin.php';
include '../../sql/conn.php';
$resultquery=0;
$namaCustomer=$_REQUEST['namaCustomer'];
$alamatCustomer=$_REQUEST['alamatCustomer'];
$attnCustomer=$_REQUEST['attnCustomer'];
$telpCustomer=$_REQUEST['telpCustomer'];
$faxCustomer=$_REQUEST['faxCustomer'];
$keterangan=$_REQUEST['keterangan'];
$id=$_REQUEST['id'];

$query=mysql_query("
UPDATE
        `bukakainti`.`customer` 
SET  
        `namaCustomer` = '$namaCustomer'
        ,`alamatCustomer` = '$alamatCustomer'
        ,`attnCustomer` = '$attnCustomer'
        ,`telpCustomer` = '$telpCustomer'
        ,`faxCustomer` = '$faxCustomer'
        ,`keterangan` = '$keterangan'
        ,`last_update` = date_format(now(),\"%Y-%m-%d\")
WHERE 
        `customer`.`idCustomer` ='$id' 
LIMIT 1
");
if( $query ){
    $resultquery=1;
}
if( $resultquery != 0 ){
    echo json_encode(array('success'=>true,'msg'=>'Customer : '.$namaCustomer.' successfully updated.'));
} else {
    echo json_encode(array('msg'=>'Error Occured. '.  mysql_error()));
}
?>